﻿@model Hit
@{
    ViewBag.Title = "Create";
    int counter = 0;
}

<h2>New Hit: @Model.Stat.Name</h2>
@using (Html.BeginForm())
{
    @Html.HiddenFor(m => m.Date)
    @Html.HiddenFor(m => m.Stat.Id)
    @Html.ValidationSummary()
    foreach (Quantity q in Model.Stat.Quantities)
    {
        <div>
            @q.Name
            <input type="number" id="HitComponents_@(counter)__Amount" name="HitComponents[@(counter)].Amount" />
            @q.Unit.Abbreviation
        </div>
        counter++;
    }
    <button type="submit">Submit</button>
}